<?php 
namespace app\model;
use think\Model;

class User extends Model
{	
	public static function getCommonIsCn($key){
		$list = ['否','是'];
		return $list[$key];
	}

	public static function getCommonIsList(){
		$list = ['否','是'];
		return $list;
	}

	public static function getStatusCn($key){
		$list = [1=>'正常',0=>'关闭'];
		return $list[$key];
	}

	public static function getStatusList(){
		$list = [1=>'正常',0=>'关闭'];
		return $list;
	}

	public static function getSwitchList(){
        $list = [3,5,10,15,20,30,45,60,90,120];
        $result = [];
        foreach ($list as $vo) {
            $result[$vo] = $vo;
        }
        return $result;
    }

    public static function searchList($map=[]){
        $list = self::field('id,account,truename')->where($map)->select();
        $result = [];
        foreach ($list as $k => $vo) {
            $result[$vo['id']] = $vo['truename'].' '.$vo['account'];
        }
        return $result;
    }
	
}


 ?>